/**
 * Created by hama on 2016/6/11.
 */




$('form').submit(function(e){
    e.preventDefault();
    var data = $(this).serialize();

    $.post('/ask',data,function(res){
        $('.modal-body').text(res.message);
        $('.modal').modal('show').on('hidden.bs.modal',function(){
            if(res.code == 'success'){
                location.href = '/';
            }
        });
    },'json')
})